package other;
import java.util.ArrayList;
import java.util.List;

import org.newdawn.slick.geom.Rectangle;

public abstract class Life extends Rectangle implements Targetable{

	private static final long serialVersionUID = -383356103796019620L;
	
	private List<Modifier> modifiers = new ArrayList<Modifier>();
	
	private float xSpeed = 0;
	private float ySpeed = 0;
	private float maxXSpeed = 2f;
	private float maxYSpeed = 2f;
	
	private int hungerLevel, maxHungerLevel;
	
	private Targetable target;
	
	public void addHunger(int hunger){
		this.hungerLevel += hunger;
	}
	
	public int getHungerLevel(){
		return this.hungerLevel;
	}
	
	public void setMaxHungerlevel(int maxHungerLevel){
		this.maxHungerLevel = maxHungerLevel;
	}
	
	public int getMaxHungerlevel(){
		return this.maxHungerLevel;
	}
	
	public float getxSpeed() {
		return xSpeed;
	}

	public void setxSpeed(float xSpeed) {
		this.xSpeed = xSpeed;
	}

	public float getySpeed() {
		return ySpeed;
	}

	public void setySpeed(float ySpeed) {
		this.ySpeed = ySpeed;
	}

	public float getMaxXSpeed() {
		return maxXSpeed;
	}

	public float getMaxYSpeed() {
		return maxYSpeed;
	}

	public List<Modifier> getModifiers() {
		return modifiers;
	}

	public void addModifier(Modifier modify) {
		this.modifiers.add(modify);
	}
	
	public void removeModifier(Modifier modify) {
		if(modifiers.contains(modify)){
			modifiers.remove(modify);
		}
	}
	
	public void clearModifiers(){
		modifiers.clear();
	}

	public Life(float x, float y, float width, float height){
		super(x, y, width, height);
	}
	
	public void move(float dx, float dy){
		setX(getX()+dx);
		setY(getY()+dy);
	}

	public Targetable getTarget() {
		return target;
	}

	public void setTarget(Targetable target) {
		this.target = target;
	}
	
}
